import axiosInstance from "../utils/axios.ts";
import type {MyResponse, PersonDTO, PersonVO} from "../types";


export const getPersonals = (companyId: number) => {
  return axiosInstance.post<any,PersonDTO[]>("/personnel/getList", undefined, {
    params: {
      id: companyId
    }
  })
}

export const insertPersonnel = (person: PersonVO) => {
  return axiosInstance.post("/personnel/save", person)
}

export const deletePersonnel = (id: number) => {
  return axiosInstance.delete<MyResponse<boolean>>("/personnel/delete", {
    params: {
      id
    }
  })
}

export const updatePersonnel = (person: PersonVO) => {
  return axiosInstance.put("/personnel/update", person)
}